#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    int N, T = 0;
    while(cin >> N){
        long long  ans = 0;
        int a[N];
        for (int i = 0; i < N; ++i) {
            cin >> a[i];
        }
        for (int i = 0; i < N; ++i) {
            long long t = a[i];
            ans = max(ans, t);
            for (int j = i+1; j < N; ++j) {
                t *= a[j];
                ans = max(ans, t);
            }
        }
        cout << "Case #" << ++T << ": The maximum product is " << ans << ".\n\n";
    }
    return 0;
}